docs: add mathematical formulas to metric docstrings#13
Conversation
jeffcarp
left a comment
There was a problem hiding this comment.
Thank you so much for the contribution @nikolasavic3! Left some nits, otherwise LGTM
src/metrax/metrics.py
Outdated
| class MSE(clu_metrics.Average): | ||
| """Computes the mean squared error for regression problems given `predictions` and `labels`.""" | ||
| r"""Computes the mean squared error for regression problems given `predictions` and `labels`. | ||
|
|
src/metrax/metrics.py
Outdated
| The Precision-Recall curve shows the tradeoff between precision and recall at different | ||
| classification thresholds. The area under this curve (AUC-PR) provides a single score | ||
| that represents the model's ability to distinguish between classes across all possible | ||
| thresholds. |
There was a problem hiding this comment.
Can this have slightly more detail to distinguish it from the docstring in AUCROC? Maybe like:
... provides a single score that represents the model's ability to identify positive cases across all possible classification thresholds, particularly in imbalanced datasets.
src/metrax/metrics.py
Outdated
| The ROC curve shows the tradeoff between the true positive rate (TPR) and false positive | ||
| rate (FPR) at different classification thresholds. The area under this curve (AUC-ROC) | ||
| provides a single score that represents the model's ability to distinguish between classes | ||
| across all possible thresholds. |
There was a problem hiding this comment.
For this one, maybe an extra detail:
... represents the model's ability to discriminate between positive and negative cases across all possible classification thresholds, regardless of class imbalance.
There was a problem hiding this comment.
Thank you for reviewing!
|
Thanks again for the contribution! |

This PR adds mathematical definitions to the metric class docstrings using Sphinx LaTeX directives.
I am attaching a pdf of the website to show how the documentation renders the math formulas.
metrax — metrax documentation.pdf
Fixes #11